<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

/**
 * 订单详情表验证器
 */
class OrderDetailValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'order_id' => 'require',
        'product_name' => 'require',
        'quantity' => 'require',
        'price' => 'require',
        'status' => 'require',
        'create_time' => 'require',
        'update_time' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'order_id' => '订单ID必须填写',
        'product_name' => '商品名称必须填写',
        'quantity' => '商品数量必须填写',
        'price' => '商品价格必须填写',
        'status' => '商品状态必须填写',
        'create_time' => '创建时间必须填写',
        'update_time' => '更新时间必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'order_id',
            'product_name',
            'quantity',
            'price',
            'status',
            'create_time',
            'update_time',
        ],
        'update' => [
            'order_id',
            'product_name',
            'quantity',
            'price',
            'status',
            'create_time',
            'update_time',
        ],
    ];

}
